#include "PatientService.h"

void* PatientService::run ( void* b )
{
  Buffer * buf_ = (Buffer*) b;
  std::map<std::string, std::string> patientInfo;

  patientInfo["010188-1234"] = "Jane Doe";
  patientInfo["311277-1234"] = "John Doe";

  Buffer::entry todo;
  std::string response;

  while( 42 )
    {
      todo = buf_->get();
      response = patientInfo[todo.msg];
      response = (response.length() == 0) ? "Not found" : response;
      todo.peer->send(response);
    }
}
